package com.ejuornal.action.interceptor;

import java.util.Map;

import com.ejuornal.util.Constants;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;

/**
 * 项目名称：ejuornal    
 * 类名称：UserPrivilege_6    
 * 类描述：  编委 权限 
 * 创建人：chenchen    
 * 创建时间：May 19, 2013 2:29:45 AM    
 * 修改人：chenchen    
 * 修改时间：May 19, 2013 2:29:45 AM    
 * 修改备注：    
 * @version     
 *
 */
public class UserPrivilege_6 implements Interceptor{
    private static final long serialVersionUID = -5532650339421909619L;

    @Override
    public void destroy() {
        // TODO Auto-generated method stub
        
    }

    @Override
    public void init() {
        // TODO Auto-generated method stub
        
    }

    @Override
    public String intercept(ActionInvocation invocation) throws Exception {
        ActionContext context = invocation.getInvocationContext();
        Map<String, Object> session = context.getSession();
        String roleId = String.valueOf(session.get(Constants.USERSESSIONROLEID));
        if(roleId == null || "".equals(roleId)) {
            return "error_userLogin";
        } else if(roleId.equals("6")) {
            return invocation.invoke();
        }  else {
            return "error_403";
        }
    }

}
